<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>营销推广</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="mx-auto max-w-[393px] h-[852px] bg-white relative overflow-hidden rounded-[40px] shadow-2xl">
        <!-- Status Bar -->
        <div class="bg-white px-6 pt-3 pb-2">
            <div class="flex justify-between items-center text-xs">
                <span class="font-semibold">9:41</span>
                <div class="flex space-x-1">
                    <i class="fas fa-signal"></i>
                    <i class="fas fa-wifi"></i>
                    <i class="fas fa-battery-full"></i>
                </div>
            </div>
        </div>

        <!-- Header -->
        <div class="bg-gradient-to-r from-orange-500 to-red-500 px-4 py-3">
            <div class="flex items-center justify-between text-white">
                <a href="home-b2c.html" class="text-white">
                    <i class="fas fa-arrow-left text-lg"></i>
                </a>
                <h1 class="text-lg font-semibold">营销中心</h1>
                <i class="fas fa-history text-lg"></i>
            </div>
        </div>

        <!-- Marketing Stats -->
        <div class="px-4 py-3 bg-gradient-to-r from-orange-500 to-red-500">
            <div class="bg-white/10 backdrop-blur-sm rounded-xl p-3">
                <div class="grid grid-cols-3 gap-3 text-white text-center">
                    <div>
                        <p class="text-xl font-bold">¥12,580</p>
                        <p class="text-xs opacity-80">本月营销收益</p>
                    </div>
                    <div>
                        <p class="text-xl font-bold">3,256</p>
                        <p class="text-xs opacity-80">新增客户</p>
                    </div>
                    <div>
                        <p class="text-xl font-bold">28.5%</p>
                        <p class="text-xs opacity-80">转化率提升</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- Scrollable Content -->
        <div class="h-[calc(852px-220px)] overflow-y-auto pb-24">
            <!-- Promotion Tools -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center">
                    <span class="w-1 h-4 bg-orange-600 mr-2 rounded-full"></span>
                    营销工具
                </h3>
                <div class="grid grid-cols-2 gap-3">
                    <div class="bg-gradient-to-br from-red-50 to-orange-50 rounded-xl p-4 border border-orange-200">
                        <div class="flex items-center justify-between mb-2">
                            <i class="fas fa-percentage text-2xl text-orange-600"></i>
                            <span class="bg-red-500 text-white text-xs px-2 py-0.5 rounded-full">热门</span>
                        </div>
                        <h4 class="font-bold text-sm mb-1">限时秒杀</h4>
                        <p class="text-xs text-gray-600 mb-2">提升销量神器</p>
                        <button onclick="createFlashSale()" class="w-full bg-orange-500 text-white text-xs py-2 rounded-lg shadow-sm hover:bg-orange-600 transition-colors font-medium">立即创建</button>
                    </div>

                    <div class="bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl p-4 border border-blue-200">
                        <div class="flex items-center justify-between mb-2">
                            <i class="fas fa-ticket-alt text-2xl text-blue-600"></i>
                            <span class="bg-green-500 text-white text-xs px-2 py-0.5 rounded-full">推荐</span>
                        </div>
                        <h4 class="font-bold text-sm mb-1">优惠券</h4>
                        <p class="text-xs text-gray-600 mb-2">提高复购率</p>
                        <button onclick="distributeCoupon()" class="w-full bg-blue-500 text-white text-xs py-2 rounded-lg shadow-sm hover:bg-blue-600 transition-colors font-medium">发放优惠券</button>
                    </div>

                    <div class="bg-gradient-to-br from-green-50 to-emerald-50 rounded-xl p-4 border border-green-200">
                        <div class="flex items-center justify-between mb-2">
                            <i class="fas fa-users text-2xl text-green-600"></i>
                        </div>
                        <h4 class="font-bold text-sm mb-1">拼团活动</h4>
                        <p class="text-xs text-gray-600 mb-2">社交裂变利器</p>
                        <button onclick="createGroupBuying()" class="w-full bg-green-500 text-white text-xs py-2 rounded-lg shadow-sm hover:bg-green-600 transition-colors font-medium">创建拼团</button>
                    </div>

                    <div class="bg-gradient-to-br from-purple-50 to-pink-50 rounded-xl p-4 border border-purple-200">
                        <div class="flex items-center justify-between mb-2">
                            <i class="fas fa-gift text-2xl text-purple-600"></i>
                        </div>
                        <h4 class="font-bold text-sm mb-1">满减活动</h4>
                        <p class="text-xs text-gray-600 mb-2">提高客单价</p>
                        <button onclick="setFullReduction()" class="w-full bg-purple-500 text-white text-xs py-2 rounded-lg shadow-sm hover:bg-purple-600 transition-colors font-medium">设置满减</button>
                    </div>
                </div>
            </div>

            <!-- Active Campaigns -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center justify-between">
                    <span class="flex items-center">
                        <span class="w-1 h-4 bg-orange-600 mr-2 rounded-full"></span>
                        进行中的活动
                    </span>
                    <span onclick="viewAllActivities()" class="text-xs text-orange-600 cursor-pointer">查看全部 <i class="fas fa-chevron-right text-xs"></i></span>
                </h3>
                <div class="space-y-3">
                    <!-- Campaign 1 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-3">
                        <div class="flex items-center justify-between mb-2">
                            <div class="flex items-center">
                                <span class="bg-orange-100 text-orange-600 text-xs px-2 py-1 rounded-full">
                                    <i class="fas fa-fire mr-1"></i>秒杀
                                </span>
                                <span class="ml-2 text-xs text-gray-500">剩余2天3小时</span>
                            </div>
                            <label class="relative inline-flex items-center cursor-pointer">
                                <input type="checkbox" checked class="sr-only peer">
                                <div class="w-9 h-5 bg-gray-200 rounded-full peer peer-checked:bg-green-500 peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all"></div>
                            </label>
                        </div>
                        <h4 class="text-sm font-medium mb-1">新年特惠秒杀</h4>
                        <div class="flex items-center justify-between text-xs text-gray-600">
                            <span>参与商品: 15个</span>
                            <span>已售: 186件</span>
                            <span>转化率: 32.5%</span>
                        </div>
                        <div class="mt-2 pt-2 border-t border-gray-100 flex justify-between">
                            <button onclick="viewActivityDetail('flash-sale-001')" class="text-blue-600 text-xs">查看详情</button>
                            <button onclick="editActivity('flash-sale-001')" class="text-gray-600 text-xs">编辑活动</button>
                        </div>
                    </div>

                    <!-- Campaign 2 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-3">
                        <div class="flex items-center justify-between mb-2">
                            <div class="flex items-center">
                                <span class="bg-blue-100 text-blue-600 text-xs px-2 py-1 rounded-full">
                                    <i class="fas fa-ticket-alt mr-1"></i>优惠券
                                </span>
                                <span class="ml-2 text-xs text-gray-500">长期有效</span>
                            </div>
                            <label class="relative inline-flex items-centers cursor-pointer">
                                <input type="checkbox" checked class="sr-only peer">
                                <div class="w-9 h-5 bg-gray-200 rounded-full peer peer-checked:bg-green-500 peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all"></div>
                            </label>
                        </div>
                        <h4 class="text-sm font-medium mb-1">新客专享优惠券</h4>
                        <div class="flex items-center justify-between text-xs text-gray-600">
                            <span>满100减20</span>
                            <span>已领: 523张</span>
                            <span>使用率: 68.2%</span>
                        </div>
                        <div class="mt-2 pt-2 border-t border-gray-100 flex justify-between">
                            <button onclick="viewActivityDetail('coupon-002')" class="text-blue-600 text-xs">查看详情</button>
                            <button onclick="editActivity('coupon-002')" class="text-gray-600 text-xs">编辑活动</button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Live Streaming -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center justify-between">
                    <span class="flex items-center">
                        <span class="w-1 h-4 bg-orange-600 mr-2 rounded-full"></span>
                        直播带货
                    </span>
                    <span class="text-xs text-orange-600">预约直播 <i class="fas fa-chevron-right text-xs"></i></span>
                </h3>
                <div class="bg-gradient-to-r from-purple-500 to-pink-500 rounded-xl p-4 text-white">
                    <div class="flex items-center justify-between mb-3">
                        <div>
                            <h4 class="text-lg font-bold mb-1">开启直播带货</h4>
                            <p class="text-xs opacity-90">实时互动，提升转化率300%</p>
                        </div>
                        <div class="w-16 h-16 bg-white/20 rounded-full flex items-center justify-center">
                            <i class="fas fa-video text-2xl"></i>
                        </div>
                    </div>
                    <div class="grid grid-cols-3 gap-3 text-center">
                        <div>
                            <p class="text-lg font-bold">12.3万</p>
                            <p class="text-xs opacity-80">累计观看</p>
                        </div>
                        <div>
                            <p class="text-lg font-bold">¥58.6万</p>
                            <p class="text-xs opacity-80">直播销售额</p>
                        </div>
                        <div>
                            <p class="text-lg font-bold">45.2%</p>
                            <p class="text-xs opacity-80">转化率</p>
                        </div>
                    </div>
                    <button class="w-full bg-white text-purple-600 font-semibold text-sm py-2.5 rounded-lg mt-3 shadow-sm hover:bg-gray-50 transition-colors border border-white/20">
                        <i class="fas fa-play mr-2"></i>立即开播
                    </button>
                </div>
            </div>

            <!-- Marketing Analytics -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center">
                    <span class="w-1 h-4 bg-orange-600 mr-2 rounded-full"></span>
                    营销效果分析
                </h3>
                <div class="grid grid-cols-2 gap-3">
                    <div class="bg-gray-50 rounded-lg p-3 text-center">
                        <i class="fas fa-chart-line text-2xl text-blue-600 mb-2"></i>
                        <p class="text-xs text-gray-600">活动转化率</p>
                        <p class="text-lg font-bold">28.5%</p>
                        <p class="text-xs text-green-600">
                            <i class="fas fa-arrow-up mr-1"></i>+5.2%
                        </p>
                    </div>
                    <div class="bg-gray-50 rounded-lg p-3 text-center">
                        <i class="fas fa-shopping-cart text-2xl text-green-600 mb-2"></i>
                        <p class="text-xs text-gray-600">活动销售额</p>
                        <p class="text-lg font-bold">¥128.5K</p>
                        <p class="text-xs text-green-600">
                            <i class="fas fa-arrow-up mr-1"></i>+12.8%
                        </p>
                    </div>
                    <div class="bg-gray-50 rounded-lg p-3 text-center">
                        <i class="fas fa-users text-2xl text-purple-600 mb-2"></i>
                        <p class="text-xs text-gray-600">新增客户</p>
                        <p class="text-lg font-bold">3,256</p>
                        <p class="text-xs text-green-600">
                            <i class="fas fa-arrow-up mr-1"></i>+23.5%
                        </p>
                    </div>
                    <div class="bg-gray-50 rounded-lg p-3 text-center">
                        <i class="fas fa-redo text-2xl text-orange-600 mb-2"></i>
                        <p class="text-xs text-gray-600">复购率</p>
                        <p class="text-lg font-bold">42.3%</p>
                        <p class="text-xs text-green-600">
                            <i class="fas fa-arrow-up mr-1"></i>+8.6%
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Marketing tool functions
        function createFlashSale() {
            window.location.href = 'flash-sale-create.html';
        }

        function distributeCoupon() {
            window.location.href = 'coupon-distribute.html';
        }

        function createGroupBuying() {
            window.location.href = 'group-buying-create.html';
        }

        function setFullReduction() {
            window.location.href = 'full-reduction-setup.html';
        }

        // Activity management functions
        function viewAllActivities() {
            window.location.href = 'activities-list.html';
        }

        function viewActivityDetail(activityId) {
            window.location.href = `activity-detail.html?id=${activityId}`;
        }

        function editActivity(activityId) {
            window.location.href = `activity-edit.html?id=${activityId}`;
        }

        // Toast notification function
        function showToast(message) {
            const toast = document.createElement('div');
            toast.className = 'fixed top-20 left-1/2 transform -translate-x-1/2 bg-gray-800 text-white px-4 py-2 rounded-lg text-sm z-50';
            toast.textContent = message;
            document.body.appendChild(toast);
            
            setTimeout(() => {
                toast.remove();
            }, 2000);
        }
    </script>
</body>
</html>